<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>项目详情-采购询价</title>
<link href="/res/css/respective/priceAsk/buyer.css" rel="stylesheet">
<script src="/res/js/common/jquery.1.9.1.min.js"></script>
</head>
<body>
[#assign  menucode ="myProject"]
	<div class="warp">
		[#include "/front/common/front_headAzt.html"]
		<div class="backcontent">
			[#include "/front/common/front_leftAzt.html"]
			<div class="back-main">
				<div class="mainContent">
					<div class="mainContentWhite">
						<h1>项目详情</h1>
						<label class="opDetail" style="text-align: right; float: right;">
							[#if project.state!=2  && userid==project.userId!0 ]
                            <a onclick="closeproject(${project.id})"   style="margin-right: 25px;"  >取消项目</a>
							[/#if]
							<a href="/enquiry/project/list">返回我的项目</a></label>
						<hr>
							<h2>项目基本信息</h2>
							<div class="baseInfo">
								<div>
									<dfn>
										项目名称：<span>${project.projectName!} </span>
									</dfn>
									<dfn>
										发布公司：<span>${project.companyName!} </span>
									</dfn>
								</div>
								<div>
									<dfn>
										甲方名称：<span>${project.customerName!}</span>
									</dfn>
									<dfn>
                                        项目所在地：<span>${project.getAddressName("-")}</span>
									</dfn>
								</div>
								<div>
									<dfn>
										创建人员：<span>${project.userName!}</span>
									</dfn>
								</div>
							</div>
						<table class="table noBorder" style="text-align: center;">
							<caption class="buyerTab">
								 <button class="tabButt" onclick="go(${project.id},2)" type="button">采购询价</button>
                                <button class="tabButt" onclick="go(${project.id},1)" type="button"  >预算询价</button>
                                <button class="tabButt tabButtActive" style="border-right: 1px solid #e9e9e9;" onclick="go(${project.id},3)" type="button">成本核算</button>
                                <div class="tableRight">
										<span style="color: #666666;vertical-align: middle;">类型：</span>
										<div class="ppSelect"
											style="display: inline-block; background: url(/res/images/checkBoxRadio/blueSelect_03.jpg) right center no-repeat; height: 20px;">
											[#assign v = pagination.params.budgettype ]
											<select onchange="sosuo()" id="so_type"
												style="height: 100%; border: none;background: none;">
												<option [#if v=="-1"] selected="selected" [/#if] value="-1">所有类型</option>
												<option [#if v=="2" ]  selected="selected"  [/#if]  value="2" >采购成本</option>
												<option [#if v=="1" ]  selected="selected"  [/#if] value="1" >预算成本</option>
											</select>
										</div>
									</div>
							</caption>
								<thead>
									<tr>
										<th style="width: 20%;">生成时间</th>
										<th style="width: 40%;">涉及商品类目</th>
										<th style="width: 20%;">类型</th>
										<th style="width: 20%;">操作</th>
									</tr>
								</thead>
								<tbody>
									<!--默认显示8行-->
									[#list pagination.list as enq]
									<tr>
										<td>${enq.createtime?string("yyyy-MM-dd HH:mm:ss")}</td>
										<td class="textoverflow"><em class="opLink">${enq.categroyNames!}</em></td>
										<td class="type">[#if enq.qtype==1]预算成本[#else]采购成本[/#if]</td>
										<td>
											<a href="/enquiry/budget/detail/${enq.id}/t/${enq.qtype}" class="opLink">查看详情</a>
										</td>
									</tr>
									[/#list]

								</tbody>
								<tfoot class="goFenYe">[@fenye p = pagination form = 'infoForm' /]
								</tfoot>
							</table> 
					</div>
				</div>
			</div>
			<!-- 底部菜单-->
			[#include "/front/common/front_footerAzt.html"]
		</div>

	</div>

	<script src="/res/js/buyer/buyer.js"></script> 
	<script src="/res/js/common/common.js"></script>
    <script src="/res/third/layer/layer.js"></script>
    <script src="/res/third/layer/layer.extends.js"></script>
	<script type="text/javascript">
	  function go(id,type){
		 window.location.href= "/enquiry/project/detail/p/"+id+"/t/"+type;
	  } 
	  
	function sosuo() {
		var v = $("#so_type").val();
		$("#budgettype").val(v);
        goPage(1);
	}
      function closeproject(projectId) {
          layer.confirm("确认取消项目?",function () {
              layer.post({
                  url:"/enquiry/project/close",
                  data:{projectId:projectId},
                  success:function (data) {
                      if(data.success) {
                      	location.reload();
                      }else{
                          layer.msgShort("有待付款订单,不能取消!")
                      }
                  }

              })
          })
      }
	</script>
</body>
</html>
